package org.xcorpio.java8.chapter08;

public class AnonymousToLambda {

    int a = 10;
    Runnable r1 = new Runnable() {
        @Override
        public void run() {
            int a = 3;
            System.out.println("Hello anonymous class," + a);
        }
    };
    Runnable r2 = () -> {
        int a = 4;
        System.out.println("Hello lambda," + a);
    };
    
    public static void main(String[] args) {
        AnonymousToLambda aLambda = new AnonymousToLambda();
        aLambda.r1.run();
        aLambda.r2.run();
    }
}
